/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.tuserinfo.service;

import java.util.List;

import com.jeeplus.common.json.AjaxJson;
import com.jeeplus.mob.common.StringHelper;
import com.jeeplus.modules.tgroupinfo.entity.TGroupInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.tuserinfo.entity.TUserInfo;
import com.jeeplus.modules.tuserinfo.mapper.TUserInfoMapper;

/**
 * 用户信息Service
 * @author pr
 * @version 2022-04-15
 */
@Service
@Transactional(readOnly = true)
public class TUserInfoService extends CrudService<TUserInfoMapper, TUserInfo> {

	@Autowired
	private TUserInfoMapper tUserInfoMapper;

	public AjaxJson queryUserInfoByGroupId(String id,String departmentId){
		List<TUserInfo> tUserInfoList = tUserInfoMapper.queryUserInfoByGroupId(id,departmentId);
		if (tUserInfoList.size() > 0 && !StringHelper.IsEmptyOrNull(tUserInfoList)) {
			return AjaxJson.success().put("result",tUserInfoList);
		}
		return AjaxJson.success("无数据结果，请重试");
	}

	public TUserInfo get(String id) {
		return super.get(id);
	}
	
	public List<TUserInfo> findList(TUserInfo tUserInfo) {
		return super.findList(tUserInfo);
	}
	
	public Page<TUserInfo> findPage(Page<TUserInfo> page, TUserInfo tUserInfo) {
		return super.findPage(page, tUserInfo);
	}
	
	@Transactional(readOnly = false)
	public void save(TUserInfo tUserInfo) {
		super.save(tUserInfo);
	}
	
	@Transactional(readOnly = false)
	public void delete(TUserInfo tUserInfo) {
		super.delete(tUserInfo);
	}

	public Page<TUserInfo> listEscape(Page<TUserInfo> page, TUserInfo tUserInfo) {
		return tUserInfoMapper.findListEscape(page, tUserInfo);
	}
	
}